import request from '@/API/request'

export const getTotalNum = () => {
  const token = localStorage.getItem('token')
  if (token) {
    return request({
      url: 'api/cart/num',
      method: 'get'
    }).then(res => {
      return res
    })
  } else {
    return console.log('未登录，无法获取购物车总数量')
  }
}
